package com.house;

import com.house.interceptor.MyInterceptor;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

public class MvcConfiger implements WebMvcConfigurer {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        MyInterceptor mi = new MyInterceptor();
        registry.addInterceptor(mi)
                .addPathPatterns("/**")
                .excludePathPatterns("/static/**");//.addPathPatterns("/**")添加所有进行拦截.excludePathPatterns("/static/**");排除静态资源拦截
    }
}
